#ifndef __BSP_UART_H
#define __BSP_UART_H

#include "stdint.h"

#define UART1_RX_PDMA_CH	0
#define UART2_RX_PDMA_CH	1
#define UART1_RX_BUF_SIZE	4096
#define UART2_RX_BUF_SIZE	64

#define UART1_RX_PDMA_EN	1
#define UART2_RX_PDMA_EN	1

typedef enum {
	UART_COM1,
	UART_COM2
} UART_COM_LIST;

void UartInit(UART_COM_LIST com, uint32_t baud);
int UartPrintf(UART_COM_LIST com, const char *format, ...);
void UartPuts(UART_COM_LIST com, const char *str);
void UartRawSend(UART_COM_LIST com, uint8_t *data, uint16_t len);
void UartClearBuffer(UART_COM_LIST com);
uint8_t *UartGetRxBuffer(UART_COM_LIST com);
uint16_t UartGetReceiveLen(UART_COM_LIST com);

void UartCallbackInPDMAISR(UART_COM_LIST com);

#endif
